///Losers Effect Models

	***Created: 10/23/25
	***Late Updated: 1/31/26
	
///Personal Vote Count Confidence Models

meologit personal_confidence i.lag_presidential_winner i.lag_senate_winner c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m1_1_1		
	
		est restore m1_1_1
		
			margins, at(lag_presidential_winner=(0(1)1)) atmeans 
			
			margins, at(lag_senate_winner=(0(1)1)) atmeans 
			
			margins, at(ritter_tolbert_cea=(0(10)100)) atmeans 
	
meologit personal_confidence i.lag_presidential_winner##c.ritter_tolbert_cea i.lag_senate_winner##c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m2_1_1
	
		est restore m2_1_1
		
			margins, at(lag_presidential_winner=0 ritter_tolbert_cea=(0(10)100)) atmeans predict(pr outcome(3)) saving(mlm1, replace)
			
			margins, at(lag_presidential_winner=1 ritter_tolbert_cea=(0(10)100)) atmeans predict(pr outcome(3)) saving(mlm2, replace)
			
				combomarginsplot mlm1 mlm2, labels("Loser" "Winner") xlabel(0(10)100) ylabel(.56 " " .57 " " .58 " " .59 " " .60 .61 " " .62 " " .63 " " .64 " " .65 .66 " " .67 " " .68 " " .69 " " .70 .71 " " .72 " " .73 " " .74 " " .75 .76 " " .77 " " .78 " ") xtitle("CEA") ytitle("Pr(Confident)") title("Presidential Winners and Losers")
	
			margins, at(lag_senate_winner=0 ritter_tolbert_cea=(0(10)100)) atmeans predict(pr outcome(3)) saving(mlm3, replace)
			
			margins, at(lag_senate_winner=1 ritter_tolbert_cea=(0(10)100)) atmeans predict(pr outcome(3)) saving(mlm4, replace)
			
				combomarginsplot mlm3 mlm4, labels("Loser" "Winner") xlabel(0(10)100) ylabel(.56 " " .57 " " .58 " " .59 " " .60 .61 " " .62 " " .63 " " .64 " " .65 .66 " " .67 " " .68 " " .69 " " .70 .71 " " .72 " " .73 " " .74 " " .75 .76 " " .77 " " .78 " ") xtitle("CEA") ytitle("Pr(Confident)") title("Senate Winners and Losers")
	
esttab m1_1_1 m2_1_1  using "C:\Users\Michael\Desktop\losereffectmodels1_1.rtf", ///
		label nonumber title("Table 2: Impact of Election Winners and County Election Administration on Personal Vote Confidence, 2012 to 2022") ///
		mtitle("Baseline" "CEA x Winners/Losers") ///
		coeflabel(covi100 "COVI" ritter_tolbert_cea "CEA" ///
		1.lag_presidential_winner "Presidential Winner" 1.lag_senate_winner "Senate Winner" ///
		female "Female" education "Education" income_quintile "Income Quintile" ///
		black "Black" hisp "Hispanic" republican_scale "Republican Scale" ///
		democratic_scale "Democratic Scale" ///
		pol_comp100 "Vote Margin" ///
		midterm_election "Midterm Election" ///
		 _con "Constant") ///
		order(1.lag_presidential_winner 1.lag_senate_winner ritter_tolbert_cea ///
		covi100 pol_comp100 female education income_quintile ///
		black hisp republican_scale democratic_scale midterm_election ///
		 _con) b(4) se(3) pr2 ///
		varwidth(10) modelwidth(6) noomitted nonumbers unstack obslast nogaps ///
		onecell star(* 0.10 ** 0.05 *** 0.001) replace 
		
///County Vote Count Confidence Models
		
meologit county_confidence i.lag_presidential_winner i.lag_senate_winner c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m3_1_1		
	
		est restore m3_1_1
	
			margins, at(lag_presidential_winner=(0(1)1)) atmeans 
			
			margins, at(lag_senate_winner=(0(1)1)) atmeans 
			

meologit county_confidence i.lag_presidential_winner##c.ritter_tolbert_cea i.lag_senate_winner##c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m4_1_1
	
			est restore m4_1_1

			margins, at(lag_senate_winner=0 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm7, replace)
			
			margins, at(lag_senate_winner=1 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm8, replace)
			
				combomarginsplot mlm7 mlm8, labels("Loser" "Winner") xlabel(0(10)100) ylabel(.48 " " .49 " " .50 .51 " " .52 " " .53 " " .54 " " .55 .56 " " .57 " " .58 " " .59 " " .60 .61 " " .62 " " .63 " " .64 " " .65 .66 " " .67 " " .68 " " .69 " " .70 .71 " " .72 " " .73 " " .74 " ") xtitle("County Election Administration (CEA) Index") ytitle("Pr(Confident)") title("Senate Winners and Losers")
	
esttab m3_1_1 m4_1_1  using "C:\Users\Michael\Desktop\losereffectmodels1_1.rtf", ///
		label nonumber title("Impact of Election Winners and County Election Administration on County Vote Confidence, 2012 to 2022") ///
		mtitle("Baseline" "CEA x Winners/Losers") ///
		coeflabel(covi100 "COVI" ritter_tolbert_cea "CEA" ///
		1.lag_presidential_winner "Presidential Winner" 1.lag_senate_winner "Senate Winner" ///
		female "Female" education "Education" income_quintile "Income Quintile" ///
		black "Black" hisp "Hispanic" republican_scale "Republican Scale" ///
		democratic_scale "Democratic Scale" ///
		pol_comp100 "Vote Margin" ///
		midterm_election "Midterm Election" ///
		 _con "Constant") ///
		order(1.lag_presidential_winner 1.lag_senate_winner ritter_tolbert_cea ///
		covi100 pol_comp100 female education income_quintile ///
		black hisp republican_scale democratic_scale midterm_election ///
		 _con) b(4) se(3) pr2 ///
		varwidth(10) modelwidth(6) noomitted nonumbers unstack obslast nogaps ///
		onecell star(* 0.10 ** 0.05 *** 0.001) replace 
		
///State Vote Count Confidence Models
		
meologit state_confidence i.lag_presidential_winner i.lag_senate_winner c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m5_1_1
	

meologit state_confidence i.lag_presidential_winner##c.ritter_tolbert_cea i.lag_senate_winner##c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m6_1_1
	
			margins, at(lag_presidential_winner=0 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm9, replace)
			
			margins, at(lag_presidential_winner=1 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm10, replace)
			
				combomarginsplot mlm9 mlm10, labels("Loser" "Winner") xlabel(0(10)100) ylabel(.38 " " .39 " " .40 .41 " " .42 " " .43 " " .44 " " .45 .46 " " .47 " " .48 " " .49 " " .50 .51 " " .52 " " .53 " " .54 " " .55 .56 " " .57 " " .58 " " .59 " " .60 .61 " " .62 " " .63 " " .64 " " .65 .66 " " .67 " " .68 " " .69 " " .70 .71 " ") xtitle("CEA") ytitle("Pr(Confident)") title("Presidential Winners and Losers")
	
			margins, at(lag_senate_winner=0 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm11, replace)
			
			margins, at(lag_senate_winner=1 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm12, replace)
			
				combomarginsplot mlm11 mlm12, labels("Loser" "Winner") xlabel(0(10)100) ylabel(.38 " " .39 " " .40 .41 " " .42 " " .43 " " .44 " " .45 .46 " " .47 " " .48 " " .49 " " .50 .51 " " .52 " " .53 " " .54 " " .55 .56 " " .57 " " .58 " " .59 " " .60 .61 " " .62 " " .63 " " .64 " " .65 .66 " " .67 " " .68 " " .69 " " .70 .71 " ") xtitle("CEA") ytitle("Pr(Confident)") title("Senate Winners and Losers")
	
esttab m4_1_1 m5_1_1  using "C:\Users\Michael\Desktop\losereffectmodels3_1.rtf", ///
		label nonumber title("Table 4: Impact of Election Winners and County Election Administration on State Vote Confidence, 2012 to 2022") ///
		mtitle("Baseline" "CEA x Winners/Losers") ///
		coeflabel(covi100 "COVI" ritter_tolbert_cea "CEA" ///
		1.lag_presidential_winner "Presidential Winner" 1.lag_senate_winner "Senate Winner" ///
		female "Female" education "Education" income_quintile "Income Quintile" ///
		black "Black" hisp "Hispanic" republican_scale "Republican Scale" ///
		democratic_scale "Democratic Scale" ///
		pol_comp100 "Vote Margin" ///
		midterm_election "Midterm Election" ///
		 _con "Constant") ///
		order(1.lag_presidential_winner 1.lag_senate_winner ritter_tolbert_cea ///
		covi100 pol_comp100 female education income_quintile ///
		black hisp republican_scale democratic_scale midterm_election ///
		 _con) b(4) se(3) pr2 ///
		varwidth(10) modelwidth(6) noomitted nonumbers unstack obslast nogaps ///
		onecell star(* 0.10 ** 0.05 *** 0.001) replace 
		
///National Vote Count Confidence Models
		
meologit national_confidence i.lag_presidential_winner i.lag_senate_winner c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m7_1_1	
	
meologit national_confidence i.lag_presidential_winner##c.ritter_tolbert_cea i.lag_senate_winner##c.ritter_tolbert_cea covi100 pol_comp100 female education income_quintile black hisp republican_scale democratic_scale median_income racial_diversity republican_trifecta midterm_election [pw=weight] || county_fip: || year:

	eststo m8_1_1
	
			margins, at(lag_presidential_winner=0 ritter_tolbert_cea=(0(10)100)) atmeans 
			
			margins, at(lag_presidential_winner=1 ritter_tolbert_cea=(0(10)100)) atmeans 
	
			margins, at(lag_senate_winner=0 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm15, replace)
			
			margins, at(lag_senate_winner=1 ritter_tolbert_cea=(0(10)100)) predict(pr outcome(3)) atmeans saving(mlm16, replace)
			
				combomarginsplot mlm15 mlm16, labels("Loser" "Winner") xlabel(0(10)100) ylabel(.19 " ".20 .21 " " .22 " " .23 " " .24 " " .25 .26 " " .27 " " .28 " " .29 " " .30 .31 " " .32 " " .33 " " .34 " " .35 .36 " " .37 " " .38 " " .39 " " .40 .41 " " .42 " " .43 " " .44 " " .45 .46 " ") xtitle("CEA") ytitle("Pr(Confident)") title("Senate Winners and Losers")
	
esttab m7_1_1 m8_1_1  using "C:\Users\Michael\Desktop\losereffectmodels4_1.rtf", ///
		label nonumber title("Table 5: Impact of Election Winners and County Election Administration on National Vote Confidence, 2012 to 2022") ///
		mtitle("Baseline" "CEA x Winners/Losers") ///
		coeflabel(covi100 "COVI" ritter_tolbert_cea "CEA" ///
		1.lag_presidential_winner "Presidential Winner" 1.lag_senate_winner "Senate Winner" ///
		female "Female" education "Education" income_quintile "Income Quintile" ///
		black "Black" hisp "Hispanic" republican_scale "Republican Scale" ///
		democratic_scale "Democratic Scale" ///
		pol_comp100 "Vote Margin" ///
		midterm_election "Midterm Election" ///
		 _con "Constant") ///
		order(1.lag_presidential_winner 1.lag_senate_winner ritter_tolbert_cea ///
		covi100 pol_comp100 female education income_quintile ///
		black hisp republican_scale democratic_scale midterm_election ///
		 _con) b(4) se(3) pr2 ///
		varwidth(10) modelwidth(6) noomitted nonumbers unstack obslast nogaps ///
		onecell star(* 0.10 ** 0.05 *** 0.001) replace 
		
		
		
		
		